<template>
  <div class="home">
    <!-- <Map1 class='map'></Map1>  -->
    <transition name="top">
      <cHeader class="header"></cHeader>
    </transition>
    <Map class="map"></Map>
    <router-view></router-view>
  </div>
</template>
<script>
import Map from "../components/maps/map.vue";
import cHeader from "../components/header/header.vue";
import Bus from "../components/utils/bus.js";
import widget from "../components/widget/widget";
export default {
  name: "home",
  data () {
    return {
      headShow: true
    };
  },
  components: {
    Map,
    cHeader
  },
  mounted () {
    Bus.$on("toggle", () => {
      this.headShow = !this.headShow;
    });
  }
};
</script>
<style lang="scss" >
$precent: 100vw / 1920;
@keyframes top {
  25% {
    transform: translateY(10 * $precent);
  }
  100% {
    transform: translateY(-200 * $precent);
  }
}
// .top-enter-active,
// .top-leave-active {
//   transition: opacity 0.5s;
// }
// .top-enter,
// .top-leave-active {
//   // opacity: 0;
//   animation: top 1s;
// }

.top-enter-active {
  transition: opacity 0.5s;
}
.top-enter {
  opacity: 0;
}
.top-leave-active {
  transition: opacity 0.5s;
  animation: top 1s;
}
.home {
  width: 100%;
  height: 10 * $precent;
  .map {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 100%;
    z-index: -1;
    #viewDiv[data-v-6587b508] {
      bottom: 0;
    }
  }
  .header {
    z-index: 1;
  }
}
</style>
